package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.PaasProcessMigrationDao;
import com.xbongbong.paas.model.PaasProcessMigrationModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.CollectionsUtil;
import com.xbongbong.pro.domain.entity.PaasProcessMigrationEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/11/03 14:04
 */
@Service("paasProcessMigrationModel")
public class PaasProcessMigrationModelImpl implements PaasProcessMigrationModel {

    @Resource
    private PaasProcessMigrationDao paasProcessMigrationDao;
    @Override
    public void insertBatch(List<PaasProcessMigrationEntity> list) {
        if (CollectionsUtil.isEmpty(list)) {
            return;
        }
        paasProcessMigrationDao.insertBatch(list);
    }

    @Override
    public Integer insert(PaasProcessMigrationEntity entity) throws XbbException {
        return paasProcessMigrationDao.insert(entity);
    }

    @Override
    public Integer update(PaasProcessMigrationEntity entity) throws XbbException {
        return paasProcessMigrationDao.update(entity);
    }

    @Override
    public List<PaasProcessMigrationEntity> findEntitys(Map<String, Object> entity) {
        return paasProcessMigrationDao.findEntitys(entity);
    }

    @Override
    public PaasProcessMigrationEntity getByKey(Long key, String corpid) {
        return paasProcessMigrationDao.getByKey(key, corpid);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> entity) {
        return paasProcessMigrationDao.getEntitysCount(entity);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public Integer delete(Long key, String corpid) {
        return paasProcessMigrationDao.deleteByKey(key, corpid);
    }
}
